import {get, post, put} from "~/api/request";
import type {ArticleQuery} from "./types";
import type {BlogCommentWebBo} from "../comment/types";

// 查询文章列表
export const queryArticleList = async (params: ArticleQuery) => {
    return await get("/blog-web/article/list",true, params);
};
// 文章浏览
export const view = async (articleId: string | number) => {
    return await put(`/blog-web/article/view/${articleId}`);
};
// 文章点赞
export const like = async (articleId: string | number) => {
    return await put(`/blog-web/article/like/${articleId}`,true);
};
// 查询文章信息
export const queryArticleDetail = async (articleId: string | number) => {
    const res = await get(`/blog-web/article/${articleId}`,true);
    return res.data;
};
// 评论
export const comment = async (data: BlogCommentWebBo) => {
    return await post("/blog-web/article/comment", true, data);
};
// 查询文章归档
export const queryArticleArchiveList = async () => {
    const res = await get("/blog-web/article/archiveList");
    return res.data
};
// 查询关于我的文章
export const queryAboutMe = async () => {
    const res = await get("/blog-web/article/aboutMe");
    return res.data
};
